<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
    <head>
    <link href="<c:url value="/resources/homepage.css" />" rel="stylesheet">
    
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addrole</title>
</head>
<body>
	<div id="wrapper">
		<!-- ============ HEADER SECTION ============== -->
		<div id="header">
			<div id="headerlogo"></div>
		</div>
		<!-- ============ NAVIGATION SECTION ============== -->
		<div id="menubar">

			<ul>
				<li><a href="Admin">Home</a>
				</li>
				<li><a href="Addemp">Employee</a>
				</li>
				<li><a href="Addrole">Role</a>			
				</li>
				<li><a href="Platform">Platform</a>
				</li>
				<li><a href="AddClient">Client</a>
				</li>
				 <li><a href="AddStoryPoints">Story Points</a>
				 </li>
				
				<li><a href="logout">Logout</a>
				</li>
			</ul>
		</div>
		<div id="m1">
			<fieldset>
				<legend>
					<h3>Add Roll</h3>
				</legend>

				<form:form action="saveRole" method="post" modelAttribute="role">
				<form:hidden path="roleId"/>
				<table>
				<tr>
				<th>Role Name</th>
				<td><form:input path="roleName" style="width: 300px" /></td>
				</tr>
								<tr>
				<th>Role Description</th>
				<td><form:input path="roleDescription" style="width: 300px" /></td>
				</tr>
				</table>

			<input type="reset" value="Reset" style="margin-left: 50px; width: 70px; height: 30px"> 
			<input type="submit" value="Save" style="margin-left: 50px; width: 70px; height: 30px"> 
			</fieldset>
			</form:form>

		</div>
		<div id="main">
		
	<table>
	        	<th>No</th>
	        	<th>Name</th>
	        	<th>Description</th>
	        	<th>Edit</th>
	        	<th>Delete</th>
				<c:forEach var="role" items="${listRole}" varStatus="status">
	        	<tr>
	        		<td>${status.index + 1}</td>
					<td>${role.roleName}</td>
					<td>${role.roleDescription}</td>
					<td>
						<a href="editRole?roleId=${role.roleId}">Edit</a>
						&nbsp;&nbsp;&nbsp;&nbsp;</td>
					<td>	<a href="deleteRole?roleId=${role.roleId}">Delete</a>
					</td>
							
	        	</tr>
				</c:forEach>	
				</table>    
		
		</div>

		<div id="footer">
			<p>Copyright &copy; 2014 - All Rights Reserved - Spring Computing
				Pvt. Ltd.</p>
		</div>
	</div>
</body>
</html>